package com.Mt.Mager.Contorller;


import com.Mt.Dto.Dto;
import com.Mt.Service.Mt_UserService;
import com.Mt.Utils.DtoUtil;
import com.Mt.pojo.Mt_User;
import com.Mt.pojo.Page;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;



@RestController
@RequestMapping("admin")
public class Mt_UserController {

    @Reference
    private Mt_UserService mt_userService;

     //修改数据
    @PostMapping("update")
    public Dto update(@RequestBody Mt_User mt_user){
        return DtoUtil.returnSuccessData( mt_userService.update(mt_user));
    }
    //查询数据
    @PostMapping("selAll")
    public Dto selAll(@RequestBody Mt_User mt_user){

        return DtoUtil.returnSuccessData(mt_userService.selAll(mt_user));

    }
    //分页
 @PostMapping("page/{index}")
    public Page page(@PathVariable("index") int index){
        Page<Mt_User>mt_user=mt_userService.page(index);
        return mt_user;
 }
}

